The present invention relates to a cache control method capable of speeding up the write process for writing data from a data processing apparatus into a storage unit by using a cache memory, and a cache control apparatus suitable for practicing the cache control method as above.
For use with information processing systems having a data processing apparatus, a control unit for a cache memory, and a storage unit, respectively interconnected together, there has been proposed the method of controlling the writing of data from the data processing apparatus into the storage unit, as described for example in Japanese Laid-open publication JP-A-55-157053.
According to a first control method described in this related art, a write process by the data processing apparatus is terminated when data have been written in a cache memory. The data stored in the cache memory are written in the storage unit later at a proper time. This write process is called a write-after or write back process. Data written in the cache memory and not in the storage unit are called write-after data. In the above-mentioned Publication JP-A-55-157053, however, the technology of the manner of how data received from the data processing unit are written in the storage unit is not disclosed.
According to a second control method, the write process by the data processing apparatus is terminated only when data have been written in the storage unit.
According to a third control method, write data supplied from the data processing apparatus are classified into permanent write data and temporary write data. The write process for the permanent write data by the data processing apparatus is terminated only when the data have been written in the storage unit. On the other hand, the write process for the temporary data by the data processing apparatus is terminated when the data have been written in the cache memory. The temporary data are not intended to be written into the storage unit.
Of the three control methods, the second control method does not use a cache memory but directly access the storage unit, and the degree of using the cache memory is considerably limited in the third control method. In view of this, only the first control method is substantially a cache control method that is capable of speeding up the write process.
However, it is difficult to apply the first cache control method when data is written by the data processing apparatus into a record in the storage unit, if the record is not stored in the cache memory at that time.
The reason for this is that if, at the time of writing data from the data processing apparatus, the corresponding record is not stored in the cache memory, then there is a possibility that the record having a record number designated by the data processing apparatus is not stored in the storage unit. Furthermore, if the storage unit stores a duplicate of a record having a record number designated by the data processing apparatus, it is not possible to determine in which record the data are to be written, thereby preventing the correct write-after process.
Thus, the above cache control method is difficult to implement if a record to be written is not stored in the cache memory at the time of writing data from the data processing apparatus. Speeding up the write process is thus impossible.
There is disclosed in JP-A-59-135563 a technique for a disk controller with a cache memory and a nonvolatile memory. In JP-A-59-15563, the disk controller writes the data received from a data processing unit to both the cache memory and the nonvolatile memory. If the cache memory malfunctions before the write-after data in the cache memory are written to the disk unit, the write-after data are stored in the nonvolatile memory. Therefore, a highly reliable write-after process can be realized. However, no consideration has been paid to the case where a record of a write request issued by the data processing unit does not exist in the cache memory.
As described above, with the conventional cache control method, the speed of the write process can be increased when the record corresponding to the data being written by the data processing apparatus is stored in the cache memory at the time of data write, because the write process can be terminated when the data have been stored in the cache memory. However, if a record corresponding to the data of the data write request is not being stored in the cache memory at the time of data write, it is hard to speed up the write process.